package restlet;

import org.restlet.Component;
import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.data.Protocol;
import org.restlet.resource.Directory;

public class Component_files {
	public static final String ROOT_URI = "file:\\\\D:\\";

	public static void main(String[] args) throws Exception {
		Component component = new Component();
		component.getServers().add(Protocol.HTTP, 8182);
		component.getClients().add(Protocol.FILE);
		Application application = new Application(component.getContext()) {
			@SuppressWarnings("unused")
			public Restlet createRoot() {
				return new Directory(getContext(), ROOT_URI);
			}
		};
		component.getDefaultHost().attach("", application);
		component.start();
	}
}
